package Factory;

import Entities.Printer.Printer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

import java.lang.reflect.InvocationTargetException;


public class PrinterFactory {

    public Printer getHPPrinter() throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException,
            InstantiationException, IllegalAccessException {
        return (Printer) Class.forName("Entities.Printer.HPPrinter").getConstructor().newInstance();
    }

    public Printer getEpsonPrinter() throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException,
            InstantiationException, IllegalAccessException {
        return (Printer) Class.forName("Entities.Printer.EpsonPrinter").getConstructor().newInstance();
    }
}
